The invention relates generally to a controller for a numerical control device, and it relates in particular, to a controller that simultaneously processes a numerical control language and a higher level language.
The term "NC" as used herein means numerical control. The term "NC language" as used herein is intended to mean an NC instruction language that has a format peculiar to numerical control for operating a numerical control device, and the term "high level language" is a general purpose language such as a BASIC language.
FIG. 1 is a block diagram outlining the arrangement of a conventional numerical control device. In FIG. 1, an NC tape 1 contains a machining program in the NC language. An input section 2 comprises a reading circuit and a command decoding and processing circuit. The control device further comprises a control section 3, a memory section 4, a processor section 5, an output section 6, a machine tool 7 to be controlled, a BASIC language terminal 8 which sets and displays the BASIC language, and a change-over switch 9.
The operation of the device will be briefly described. In the case where control is effected using an NC language, an example of which is shown in Table 1, before the operation is started the change-over switch 9 is set to select the input section 2 so that the input section 2 reads the machining program on the NC tape 1. The program is interpreted by the control section 3, and the processor 5 carries out the necessary calculations according to the interpreted program. The resultant data of the calculation are stored in the memory section 4. The data thus stored are successively applied through the output section 6 to the machine tool 7, so that the tool is controlled according to the program. This control is carried out for each axis of the machine tool 7.
On the other hand, in the case where it is required to control the machine tool by using a BASIC language program, an example of which is shown in Table 2, it is necessary to set the change-over switch 9 in advance. In this case, the switch 9 is set to select the BASIC terminal 8, and the operator operates the keyboard at the terminal 9 to prepare a control program in a BASIC language while viewing a CRT (cathode ray tube) display unit, so that the machine tool is controlled according to the control program thus prepared.
As is apparent from the above description, in the conventional device shown in FIG. 1, NC language instructions are inputted from the NC tape 1 through the input section 2 to the control section 3, and BASIC language instructions are inputted from the BASIC terminal 8 to the control section. Therefore, the control section 3 is required to detect the state of the change-over switch 9, i.e., whether the switch 9 is connected to the input section 2 or the BASIC terminal 8, thereby to determine what language is used for the instruction. The machine tool is controlled according to the instruction in the language thus determined.
With the conventional NC device, the control is effected according to NC language instructions or BASIC language instructions by operating the change-over switch 9; however, it is possible to control the machine tool by using two languages simultaneously. If in the case of a simple movement instruction for "Feed the X-axis 100 mm quickly", an NC language instruction such as "GOO X 1000D;" can be used. However, BASIC language instructions can be advantageously used in the case of a special cycle instruction such as a series of operations in which, as in a deep hole drilling cycle instruction, after being dropped quickly to a certain depth, the drill is advanced by predetermined incremental distances for drilling, and after the hole has been drilled to a predetermined depth, the drill is quickly returned to its original position. The advantages of the use of two languages lies in that the BASIC special cycle can be formulated as desired by the user and the NC language simple movement instruction can be readily executed because of the simple instruction format. However, the conventional device cannot use the two languages in this manner.